using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter16
{
	/// <summary>
	/// Example06: Power Supplied to a Vibrating String
	/// A taut string for which \mu = 5.00 \times 10 kg/m is under a tension 
	/// of 80.0 N. How much power must be supplied to the string 
	/// to generate sinusoidal waves at a frequency of 60.0 Hz 
	/// and an amplitude of 6.00 cm?
	/// P = 512 W
	/// </summary>
	public class Example06
	{
		public Example06()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.SinusoidalWave y = new L.SinusoidalWave();
			y.Frequency = 60.0;
			y.Amplitude = 0.06;
			y.FindAngularFrequencyFromFrequency();
			L.Force T = new L.Force();
			T.Z = 80.0;
			L.Length l = new L.Length();
			l.m = 1.0;
			L.Mass m = new L.Mass();
			m.kg = 0.05;
			y.Speed = L.Wave.SpeedOfWaveOnString(T,m,l);
			double p = L.Wave.RateOfEnergyTransferOnString(y,m,l);
			result+=Convert.ToString(p);      
		}
	}
}
